import {defineStore} from "pinia";
import {computed, ref} from "vue";

export const useCounterStore = defineStore('counter', () => {
    const count = ref(0)   //ref对象
    const doubleCount = computed(() => count.value * 2)  //计算
    function increment() {      //时间
        count.value++
    }
    function _increment() {      //时间
        count.value--
    }

    return { count, doubleCount, increment,_increment }
})